import com.sun.org.apache.xerces.internal.impl.xs.SchemaNamespaceSupport;

import javax.sound.midi.Soundbank;
import java.util.Arrays;
import java.util.Scanner;

public class SelectSort {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = sc.nextInt();
        }
        //从小到大
        //{123, 5, 25,2, 7, 43, 6, 52, 79}
        //{2, 8, 25,123, 7, 43, 6, 52, 79}
        //{2, 6, 25,123, 7, 43, 8, 52, 79}
        //{2, 6, 7,123, 25, 43, 8, 52, 79}
        //{2, 6, 7,8, 25, 43, 123, 52, 79}

        selectSort(arr);
        for (int i = 0; i < arr.length; i++) {
            System.out.print(arr[i] + " ");
        }
    }

    public static void selectSort(int[] arr) {
       for(int i=0;i<arr.length;i++){
           int max = Integer.MIN_VALUE,maxIndex=0;
           for(int j=i;j<arr.length;j++){
               if(max < arr[j]){
                   max = arr[j];
                   maxIndex = j;
               }
           }
           int temp = arr[i];
           arr[i] = max;
           arr[maxIndex] = temp;

       }
    }
}
